package com.wuchao.convert.exception;

import java.io.Serializable;

/**
 * 定义得消息类
 * @param <T>
 */

public class Result<T> implements Serializable {

    private String message;

    private int code;

    private T other;

    public Result(String message, int code, T other) {
        this.message = "操作成功";
        this.code = 0;//0代表成功 -1代表失败
        this.other = other;
    }

    public Result(String message) {
        this.message = "操作成功";
        this.code = -1;//0代表成功 -1代表失败

    }
    public Result(String message, int code) {
        this.message = message;
        this.code = code;//0代表成功 1代表失败
    }

    public Result() {
        this.message = "操作成功";
        this.code = 0;//0代表成功 1代表失败
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getOther() {
        return other;
    }

    public void setOther(T other) {
        this.other = other;
    }
}
